package practiceTest.chap03.work5;

import chap03.BubbleSort.ArrayBub;
import chap03.InsertSort.ArrayIns;
import chap03.SelectSort.ArraySel;

import java.util.Date;

/**
 * Created by root on 2017/7/12.
 * 冒泡排序：逆序比随机快
 */
public class test2 {
    public static void main(String[] args){
        int maxSize = 10;

        ArrayIns arr2 = new ArrayIns(maxSize);
        for (int j=maxSize-1;j>=0;j--) {
            long n = (long)(Math.random()*(maxSize-1));
            arr2.insert(n);
        }
        Date startTime2 = new Date();
        arr2.InsertSortWhileNums();
        Date endTime2 = new Date();
        long time2 = endTime2.getTime() - startTime2.getTime();
        System.out.println("insertsort time is " + time2/1000 + " S");
    }
}
